#!/bin/bash
# 步骤:
# 1.crontab -e 来编辑
# 2. 写入:* * * * * /bin/bash scriptName.sh
#		*/1 * * * * /bin/bash /Shell/5.myCrontab.sh
# 3. sudo service cron restart
date >> ~/log.txt
ping -c 3 www.baidu.com > /dev/null
if [ "$?" != "0" ]; then
	echo "您已断网。。。" >> ~/log.txt
	echo "正在尝试联网..." >> ~/log.txt
	SchoolNet
else
	echo "您已联网。。。" >> ~/log.txt
fi

killall ping

exit
